/*
*   Created by Standard Generator beta version.
*   Created Date Thu Jul 24 15:38:43 GMT+07:00 2003
*/

package com.epro.standard.usermenu;

import java.util.Vector;

import com.epro.standard.infrastructure.root.KeywordCondition;
import com.epro.standard.infrastructure.root.KeywordConstant;
import com.epro.standard.infrastructure.root.KeywordElement;
import com.epro.standard.infrastructure.root.StdKeyword;

public class UserMenu_User_MenuKeyword extends StdKeyword {
    public UserMenu_User_MenuKeyword() {
        super();
        addElement("USER_MENU", "UM", "USER_ID", "String", true);
        addElement("USER_MENU", "UM", "MENU_ID", "String", true);
        addElement("USER_MENU", "UM", "ABLE_EXECUTE", "String", true);
        addElement("USER_MENU", "UM", "ABLE_INSERT", "String", true);
        addElement("USER_MENU", "UM", "ABLE_UPDATE", "String", true);
        addElement("USER_MENU", "UM", "ABLE_DELETE", "String", true);
        addElement("USER_ACCOUNT", "UA", "USER_ID", "String", false);
        addElement("USER_ACCOUNT", "UA", "USER_GROUP_ID", "String", false);
        addElement("USER_ACCOUNT", "UA", "USER_NAME", "String", false);
        addElement("USER_ACCOUNT", "UA", "USER_LOGIN", "String", false);
        addElement("USER_ACCOUNT", "UA", "USER_PASSWORD", "String", false);
        addElement("USER_ACCOUNT", "UA", "USER_PROFILE", "String", false);
        addElement("USER_ACCOUNT", "UA", "IS_CHANGE_PASSWORD", "String", 
                   false);
        addElement("USER_ACCOUNT", "UA", "LOCAL_ID", "String", false);
        addElement("USER_ACCOUNT", "UA", "ROLE_ID", "String", false);
        addElement("USER_ACCOUNT", "UA", "ACTIVE", "String", false);
        addElement("USER_ACCOUNT", "UA", "UPD_BY", "String", false);
        addElement("USER_ACCOUNT", "UA", "UPD_DATE", "Timestamp", false);
        addElement("MENU", "M", "MENU_ID", "String", false);
        addElement("MENU", "M", "PROGRAM_GROUP_ID", "String", false);
        addElement("MENU", "M", "MENU_NAME", "String", false);
        addElement("MENU", "M", "MENU_DESC", "String", false);
        addElement("MENU", "M", "PICTURE_NAME", "String", false);
        addElement("MENU", "M", "MENU_LINK", "String", false);
        addElement("MENU", "M", "PARENT_MENU_ID", "String", false);
        addElement("MENU", "M", "IS_OPERATION", "String", false);
        addElement("MENU", "M", "MENU_INDEX", "String", false);
        addElement("MENU", "M", "ACTIVE", "String", false);
        addElement("MENU", "M", "UPD_BY", "String", false);
        addElement("MENU", "M", "UPD_DATE", "Timestamp", false);
    }

    private void addElement(String tableName, String aliasName, 
                            String columnName, String type, boolean isMain) {
        elements.put(aliasName + "." + columnName, 
                     new KeywordElement(tableName, aliasName, columnName, type, 
                                        isMain));
    }

    public KeywordElement getUM_userID() {
        return (KeywordElement)elements.get("UM.USER_ID");
    }

    public KeywordElement getUM_menuID() {
        return (KeywordElement)elements.get("UM.MENU_ID");
    }

    public KeywordElement getUM_ableExecute() {
        return (KeywordElement)elements.get("UM.ABLE_EXECUTE");
    }

    public KeywordElement getUM_ableInsert() {
        return (KeywordElement)elements.get("UM.ABLE_INSERT");
    }

    public KeywordElement getUM_ableUpdate() {
        return (KeywordElement)elements.get("UM.ABLE_UPDATE");
    }

    public KeywordElement getUM_ableDelete() {
        return (KeywordElement)elements.get("UM.ABLE_DELETE");
    }

    public KeywordElement getUA_userID() {
        return (KeywordElement)elements.get("UA.USER_ID");
    }

    public KeywordElement getUA_userGroupID() {
        return (KeywordElement)elements.get("UA.USER_GROUP_ID");
    }

    public KeywordElement getUA_userName() {
        return (KeywordElement)elements.get("UA.USER_NAME");
    }

    public KeywordElement getUA_userLogin() {
        return (KeywordElement)elements.get("UA.USER_LOGIN");
    }

    public KeywordElement getUA_userPassword() {
        return (KeywordElement)elements.get("UA.USER_PASSWORD");
    }

    public KeywordElement getUA_userProfile() {
        return (KeywordElement)elements.get("UA.USER_PROFILE");
    }

    public KeywordElement getUA_isChangePassword() {
        return (KeywordElement)elements.get("UA.IS_CHANGE_PASSWORD");
    }

    public KeywordElement getUA_localID() {
        return (KeywordElement)elements.get("UA.LOCAL_ID");
    }

    public KeywordElement getUA_roleID() {
        return (KeywordElement)elements.get("UA.ROLE_ID");
    }

    public KeywordElement getUA_active() {
        return (KeywordElement)elements.get("UA.ACTIVE");
    }

    public KeywordElement getUA_updBy() {
        return (KeywordElement)elements.get("UA.UPD_BY");
    }

    public KeywordElement getUA_updDate() {
        return (KeywordElement)elements.get("UA.UPD_DATE");
    }

    public KeywordElement getM_menuID() {
        return (KeywordElement)elements.get("M.MENU_ID");
    }

    public KeywordElement getM_programGroupID() {
        return (KeywordElement)elements.get("M.PROGRAM_GROUP_ID");
    }

    public KeywordElement getM_menuName() {
        return (KeywordElement)elements.get("M.MENU_NAME");
    }

    public KeywordElement getM_menuDesc() {
        return (KeywordElement)elements.get("M.MENU_DESC");
    }

    public KeywordElement getM_pictureName() {
        return (KeywordElement)elements.get("M.PICTURE_NAME");
    }

    public KeywordElement getM_menuLink() {
        return (KeywordElement)elements.get("M.MENU_LINK");
    }

    public KeywordElement getM_parentMenuID() {
        return (KeywordElement)elements.get("M.PARENT_MENU_ID");
    }

    public KeywordElement getM_isOperation() {
        return (KeywordElement)elements.get("M.IS_OPERATION");
    }

    public KeywordElement getM_menuIndex() {
        return (KeywordElement)elements.get("M.MENU_INDEX");
    }

    public KeywordElement getM_active() {
        return (KeywordElement)elements.get("M.ACTIVE");
    }

    public KeywordElement getM_updBy() {
        return (KeywordElement)elements.get("M.UPD_BY");
    }

    public KeywordElement getM_updDate() {
        return (KeywordElement)elements.get("M.UPD_DATE");
    }

    public void setJoin(boolean join, boolean isPKJoin) {
        if (join) {
            isJoin = true;
            KeywordCondition c1 = 
                new KeywordCondition(getUM_userID(), getUA_userID(), 
                                     KeywordConstant.KEY_EQUAL, true);
            if (isPKJoin)
                mainCondition.addCondition(c1);
            KeywordCondition c2 = 
                new KeywordCondition(getUM_menuID(), getM_menuID(), 
                                     KeywordConstant.KEY_EQUAL, true);
            if (isPKJoin)
                mainCondition.addCondition(c2);
        } else {
            mainCondition.clearPKCondition();
            isJoin = false;
        }
    }

    public Vector getReturnVO(java.sql.ResultSet rs) {
        Vector returnVector = new Vector();
        try {
            while (rs.next()) {
                returnVector.addElement(new UserMenu_User_MenuVO((isColumnInResultSet("UM_USER_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_USER_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UM_MENU_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_MENU_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UM_ABLE_EXECUTE", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_ABLE_EXECUTE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UM_ABLE_INSERT", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_ABLE_INSERT") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UM_ABLE_UPDATE", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_ABLE_UPDATE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UM_ABLE_DELETE", 
                                                                                      rs)) ? 
                                                                 rs.getString("UM_ABLE_DELETE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_GROUP_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_GROUP_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_NAME", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_NAME") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_LOGIN", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_LOGIN") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_PASSWORD", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_PASSWORD") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_USER_PROFILE", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_USER_PROFILE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_IS_CHANGE_PASSWORD", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_IS_CHANGE_PASSWORD") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_LOCAL_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_LOCAL_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_ROLE_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_ROLE_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_ACTIVE", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_ACTIVE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_UPD_BY", 
                                                                                      rs)) ? 
                                                                 rs.getString("UA_UPD_BY") : 
                                                                 null, 
                                                                 (isColumnInResultSet("UA_UPD_DATE", 
                                                                                      rs)) ? 
                                                                 rs.getTimestamp("UA_UPD_DATE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_MENU_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_MENU_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_PROGRAM_GROUP_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_PROGRAM_GROUP_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_MENU_NAME", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_MENU_NAME") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_MENU_DESC", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_MENU_DESC") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_PICTURE_NAME", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_PICTURE_NAME") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_MENU_LINK", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_MENU_LINK") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_PARENT_MENU_ID", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_PARENT_MENU_ID") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_IS_OPERATION", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_IS_OPERATION") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_MENU_INDEX", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_MENU_INDEX") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_ACTIVE", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_ACTIVE") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_UPD_BY", 
                                                                                      rs)) ? 
                                                                 rs.getString("M_UPD_BY") : 
                                                                 null, 
                                                                 (isColumnInResultSet("M_UPD_DATE", 
                                                                                      rs)) ? 
                                                                 rs.getTimestamp("M_UPD_DATE") : 
                                                                 null));
            }
        } catch (java.sql.SQLException sqle) {
            sqle.printStackTrace();
        }
        return returnVector;
    }

    public void addCriteria(KeywordElement ke, String value) {
        addCommonCriteria(ke, value);
    }
}
